#include<iostream>

using namespace std;

const int N=1e5;
int a[N];
int tem[N];

void f(int left,int right)
{
    if(left>=right)  return ;
    
    int mid=left+(right-left)/2;

    f(left,mid);//计算左边
    f(mid+1,right);//计算右边

    int start1=left;
    int start2=mid+1;
    int i=left;
    while(start1<=mid&&start2<=right)
    {
        if(a[start1]<=a[start2]) tem[i++]=a[start1++];
        else tem[i++]=a[start2++];
    }
    while(start1<=mid) tem[i++]=a[start1++];
    while(start2<=right)  tem[i++]=a[start2++];

    for(int j=left;j<=right;j++)  a[j]=tem[j];
}

int main()
{
    int n=0;
    cin>>n;
    for(int i=1;i<=n;i++)  cin>>a[i];
    f(1,n); 
    for(int i=1;i<=n;i++)  cout<<a[i]<<' ';
}